<?php
/*  LOAD SYSTEM CLASSES
    ============================================================================================================== */
	require_once( "functions/inc.backnavigation.php" );

	# init session
	session_start();

/*  LOAD SYSTEM FUNCTIONS MANUALLY
    ============================================================================================================== */
	require_once( "functions/inc.database.php" );
	require_once( "functions/inc.getData.php" );
	require_once( "functions/inc.pageSetup.php" );

// delet last URL from stack; this is the current page
$_SESSION['backNavigation']->deleteLastUrl();

// get the last URL
$next_url = $_SESSION['backNavigation']->getUrl();
if(strlen($next_url) == 0)
{
    $next_url = $g_homepage;
}

// redirect to previous page
header("Location: $next_url");
?>